//
//  UILabel+XMTextMargin.h
//  XMKit
//
//  Created by chenming on 2017/12/9.
//  Copyright © 2017年 ChenXiaoMing. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, XMLabelRichTextlineStyle) {
    XMLabelRichTextStyleLine = 0, // 下划线
    XMLabelRichTextStyleStrikethrough = 1, // 删除线
};

@interface UILabel (XMTextMargin)

/** 改变行间距 */
+ (void)xm_changeLineSpaceForLabel:(UILabel *)label WithSpace:(float)space;

/** 改变字间距 */
+ (void)xm_changeWordSpaceForLabel:(UILabel *)label WithSpace:(float)space;

/** 改变行间距和字间距 */
+ (void)xm_changeSpaceForLabel:(UILabel *)label withLineSpace:(float)lineSpace WordSpace:(float)wordSpace;

/** 单行文字左右对齐 */
- (void)xm_changsinglelabelTextAlignmentRightandLeft;

/** 单行,多行文字左右对齐 */
- (void)xm_changmanylabelTextAlignmentRightandLeft;

/** label高度计算 */
- (CGFloat)xm_changeIndentationLabelHeightText:(NSString *)text withStrIndentationNum:(int)indentationNum withNSTextAlignment:(NSTextAlignment )alignment withFontSize:(CGFloat)fontSize withWidth:(CGFloat)width;

/** label高度计算 */
- (CGFloat)xm_getHeightByWidth:(CGFloat)width title:(NSString *)title font:(UIFont*)font;

/**
 *label宽度计算 适应所有
 */
- (CGSize)xm_sizeWithText:(NSString *)text maxSize:(CGSize)maxSize fontSize:(CGFloat)fontSize;

/**
 *label宽度计算 文字超出屏幕不适应
 */
- (CGFloat)xm_getWidthWithTitle:(NSString *)title font:(UIFont *)font;

/** label富文本 */
- (void)xm_changeLabelrichtext:(NSString *)text attribtStyle:(XMLabelRichTextlineStyle)attribtStyle fontSize:(CGFloat)fontSize attribtName:(NSAttributedStringKey)attribtName attribtValue:(id)attribtValue textRange:(NSRange)textRange;

@end
